package com.dddd.blog.blogpost.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dddd.blog.api.post.pojo.Post;
import com.dddd.blog.blogcommon.pojo.vo.PostVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author dddd
 * @since 2022-02-27
 */
public interface IPostService extends IService<Post> {

    /**
     * @param currentPAge
     * @param pageSize
     * @return
     */
    List<Post> getPostListByPage(long currentPAge,long pageSize);

    /**
     * @param id
     * @return
     */
    PostVO getPostById(Long id);

    /**
     * 获取文章数目
     * @return
     */
    Integer getPostCount();


    /**
     * @param post
     * @return
     */
    int addPostByMap(Map<String, Object> post);


    /**
     * 添加文章Map列表
     * @param list
     * @return
     */
    int addPostByMapList(List<Map<String, Object>> list);

    List<Post> getPostOrderByRead();

    /**
     *
     * @return
     */
    Integer getPostVisited();

    List<Map<String,Object>> getReadRank();

    List<Map<String, Object>> getCommentRank();


    /**
     * 根据作者名获取其热门
     * @param name
     * @return
     */
    List<Map<String,Object>> getHotByAuthor(String name);
}
